package com.xinnet.mms.member.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.xinnet.mms.allot.dao.impl.BaseDaoImpl;
import com.xinnet.mms.entity.Customer;
import com.xinnet.mms.member.dao.MemberDao;

@Repository("memberDao")
public class MemberDaoImpl extends BaseDaoImpl<Object, Object> implements MemberDao {

	/**
	 * 查询所有会员中心的客户
	 */
	@Override
	public List<Customer> getAllMember() throws SQLException {
		return this.getSqlSession().selectList("member.getAllMember");
	}

	/**
	 * 查询某个时间段所有会员中心的客户
	 */
	@Override
	public List<Customer> getTimeSetMember(Customer customer) throws SQLException {
		return this.getSqlSession().selectList("member.getTimeSetMember",customer);
	}

	/**
	 * 根据会员ID查询会员详细信息
	 */
	@Override
	public Customer getMemberByCusId(String cusId) throws SQLException {
		return this.getSqlSession().selectOne("member.getMemberByCusId",cusId);
	}

	/**
	 * 获取limit区间所有会员
	 */
	@Override
	public List<Customer> getMemberByLimit(Customer customer) throws Exception {
		return this.getSqlSession().selectList("member.getMemberByLimit",customer);
	}

	/**
	 * 获取会员总记录数
	 */
	@Override
	public Integer getAllMemberCount() throws SQLException {
		return this.getSqlSession().selectOne("member.getAllMemberCount");
	}

}
